from selenium.webdriver.common.by import By

from bookshop_po.base.base import Base


username=By.CSS_SELECTOR,"[placeholder='请输入用户名']"
pwd=By.CSS_SELECTOR,"[placeholder='请输入密码']"
btn=By.CLASS_NAME,"login-btn"
nickname=By.CLASS_NAME,"fa fa-user"

class PageLogin(Base):
    def __page_username(self,value):
        self.base_input(username,value)

    def __page_password(self,value):
        self.base_input(pwd,value)

    def __page_login_btn(self):
        self.base_click(btn)

    def page_get_nickname(self):
        return self.base_get_text(nickname)

    def page_login(self,phone,word):
        self.page_username(phone)
        self.page_password(word)
        self.page_login_btn()